var time = 2;
$(function() {
	$("#stu-submit-file-list").on("click","#deleteFile",function() {
		var key = $('input[name="answerAttachKey"]').val();
		$.post(CONTEXT_PATH+"resource/deleteFile?key="+key, function(data) {
			if(data.status=="success"){
				//layer.msg("服务器端删除成功");
			}else{
				//layer.msg("服务器端删除失败");
			}
		});		
		$(this).closest("li").remove();
		return false;
	});
	
	/*$("#up-file-btn").click(function() {
		var content = $('input[id="up-file-btn"]').val();
		if(content == "重新上传附件"){
			$("#ensure-build-score-layer").modal("show");
						
		    setInterval("next()",1000);
		}else{
			$('#task-stu-submit').click();
		}
		
	});
	
	$("#cancel").click(function() {
		$("#ensure-build-score-layer").modal("hide");
	});*/
});

var next = function(){
	if(time==0)
    {
        $("#confirm").attr("disabled", false); 
        $("#confirm").text("确定");
    }
    else
    {
    	$("#confirm").text("确定("+time+")");
        time--;
    }
}
